#pragma once
class FWTexture;
#include <d3dx9.h>
class Sprite
{
public:
	//tong so sprites
	int _totalFrame;
	//frame hien tai
	int _index;
	//kich thuoc sprite
	int _width;
	int _height;
	int _spritePerRow;
	FWTexture* _image;	
	int _renderWidth;
	int _renderHeight;

	RECT frame;
	RECT des;
	D3DXVECTOR2 center;
	D3DXVECTOR2 render_size;
public:

	Sprite(FWTexture* texture,int width,int height,int count,int spritePerRow,int _rWidth,int _rHeight);
	Sprite(FWTexture* texture,int width,int height,int count,int spritePerRow);
	Sprite(Sprite* sprite);
	void Render(D3DXVECTOR2 position,int width,int height);
	//use _renderWidth and _renderHeight to render texture
	void Render(D3DXVECTOR2 position);
	void Next();
	void Last();
	void Reset();
	void Reset(int frame);
	
	int getRenderWidth();
	int getRenderHeight();
	D3DXVECTOR2 getRenderSize();

	~Sprite(void);

	//for blockhouse
	int GetCurrentIndex();	
	int getCount();
	//
};

